<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>修改满返活动</h2>
    </div>
    <form action="{:U()}" method="post" class="form-horizontal">
        <input type="hidden" name='id' value="{$data.id}"/>
        <div class="form-item">
            <label class="item-label">活动名称</label>
            <div class="controls">
                <input type="text" class="text input-large" name="name" value="{$data.name}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">开始时间</label>
            <div class="controls">
                <input type="text" class="text input-large time" name="begindate" value="{$data.begindate|time_format}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">结束时间</label>
            <div class="controls">
                <input type="text" class="text input-large time" name="enddate" value="{$data.enddate|time_format}" >
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">活动分级</label>
            <div class="controls">
                <div style="border: #000 1px solid;width: 70%" class='data-table table-striped'>
                    <table >
                        <thead>
                            <tr>
                                <th>条件</th>
                                <th>优惠</th>
                            </tr>
                        </thead> 
                        <tr>
                            <td>
                                <equal name="data.isrealpay" value="1">成交金额满：</equal>
                                <equal name="data.isrealpay" value="2">订单金额满：</equal>
                                <input type="text" class="text input-small" name="account1" value="{$data.condition1}" placeholder="" >元</td>
                            <td>
                                返利：
                                <input type="text" class="text input-small" name="price1" value="{$data.reduce1}" placeholder="" >
                                <equal name="data.reduce_type" value="1">%</equal>
                                <equal name="data.reduce_type" value="2">元</equal>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <equal name="data.isrealpay" value="1">成交金额满：</equal>
                                <equal name="data.isrealpay" value="2">订单金额满：</equal>
                                <input type="text" class="text input-small" name="account2" value="{$data.condition2}" placeholder="" >
                                元
                            </td>
                            <td>
                                返利：
                                <input type="text" class="text input-small" name="price2" value="{$data.reduce2}" placeholder="" >
                                <equal name="data.reduce_type" value="1">%</equal>
                                <equal name="data.reduce_type" value="2">元</equal>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">活动地区<span class="check-tips">（设置活动地区）</span></label>
            <div class="controls">
                <volist name="arealabel" id="vo">
                    <if condition='$vo.check == 1'>
                        <div style="display: inline"><input class="ids" type="checkbox" name="tagarray[]" value="{$key}" checked/>{$vo}</div>
                        <else />
                        <div style="display: inline"><input class="ids" type="checkbox" name="tagarray[]" value="{$key}"/>{$vo}</div>
                    </if>
                </volist>
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label text-danger">是否生效!!<span class="check-tips">（选择活动是否生效）</span></label>
            <div class="controls">
                <input type="checkbox" name="isNice" <eq name="data.status" value="1"> checked</eq> />活动生效
            </div>
        </div>
        <div class="form-item">
            <button class="btn submit-btn" id="submit" type="submit" target-form="form-horizontal">保 存</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
     <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script type="text/javascript">
        highlight_subnav('{:U('BuySend/index')}');
        
        $(function(){
            $('.time').datetimepicker({
                format: 'yyyy-mm-dd hh:ii:ss',
                language:"zh-CN",
                minView:2,
                autoclose:true
            });
            showTab();
        });
    </script>
    
</block>
